package com.duoec.dw.lineage.service.analyser.statement;

import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.ast.statement.SQLCommentStatement;
import com.duoec.dw.lineage.enums.StatementType;
import com.duoec.dw.lineage.dto.TableLineageDto;
import com.google.common.collect.Sets;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * @author xuwenzhen
 */
@Service
public class CommentStatementAnalyser extends BaseStatementAnalyser<SQLCommentStatement> {
    /**
     * 匹配具体的SQLStatement
     *
     * @return 匹配类型
     */
    @Override
    public Set<Class<? extends SQLStatement>> parseSqlStatements() {
        return Sets.newHashSet(SQLCommentStatement.class);
    }

    /**
     * 分析
     *
     * @param statement SQLStatement
     * @return 当前操作的血缘关系
     */
    @Override
    public TableLineageDto analyse(SQLCommentStatement statement) {
        TableLineageDto dto = new TableLineageDto();
        dto.setStatementType(StatementType.OTHER);
        return dto;
    }
}
